﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KmSql
{
    public interface IAdo
    {
        string ConnectionString { get; }
        Task<DataTable> QueryAsync(string sql, SqlParameter[]? pars = null);
        Task<List<T>> QueryAsync<T>(string sql, SqlParameter[]? pars = null) where T : class;
        Task<T?> FirstAsync<T>(string sql, SqlParameter[]? pars = null) where T : class;
        Task<int> ExecuteNonQueryAsync(string sql, SqlParameter[]? pars = null);
        Task<object?> ExecuteScalarAsync(string sql, SqlParameter[]? pars = null);
    }
}
